History log of /u-boot/include/tpm-common.h
Revision Date Author Comments
# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a11be4c3 21-Feb-2023 Simon Glass <sjg@chromium.org>

tpm: Implement tpm_auto_start() for TPMv1.2

Add an implementation of this, moving the common call to tpm_init() up
into the common API implementation.

Add a test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 3bb4db4c 30-Aug-2022 Simon Glass <sjg@chromium.org>

tpm: Allow reporting the internal state

It is useful to read information about the current TPM state, where
supported, e.g. for debugging purposes when verified boot fails.

Add support for this to the TPM interface as well as Cr50. Add a simple
sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6719cbe3 06-Feb-2021 Simon Glass <sjg@chromium.org>

tpm: Add TPM2 support for read/write values

Implement this API function for TPM2.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 09140113 10-May-2020 Simon Glass <sjg@chromium.org>

command: Remove the cmd_tbl_t typedef

We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bb3f47eb 09-Jan-2020 Philippe Reynes <philippe.reynes@softathome.com>

tpm: add a helper to iterate on all tpm devices

This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 5e69b8bc 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export tpm_clear_and_reenable()

This function is intended to be exported but is not. Add it to the header
file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0a60a0a6 23-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Remove use of build-time TPM versions

There is only one place in the code which assumes at build-time that we
are using either a v1 or a v2 TPM. Fix this up and add a new function to
return the version of a TPM.

Supported TPM versions (v1 and v2) can be enabled independently and it is
possible to use both versions at once. This is useful for sandbox when
running tests.

Signed-off-by: Simon Glass <sjg@chromium.org>


# abdc7b8a 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Convert to use a device parameter

At present many TPM calls assume there is only one TPM in the system and
look up this TPM themselves. This is inconsistent with driver model, which
expects all driver methods to have a device parameter. Update the code to
correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 51f00c17 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Export the open/close functions

At present these functions are not accessible outside the TPM library, but
in some cases we need to call them. Export them in the header file and add
a define for the SHA1 digest size.

Also adjust tpm_open() to call tpm_close() first so that the TPM is in a
known state before opening (e.g. by a previous phase of U-Boot).

Signed-off-by: Simon Glass <sjg@chromium.org>


# 07e127d8 18-Nov-2018 Simon Glass <sjg@chromium.org>

tpm: Add a constant for the minimum supported digest size

When SHA1 is used we need 20 bytes for the digest size. Add a constant so
that clients can make use of this, e.g. to allocate local buffers.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2a2096ea 19-Jul-2018 Miquel Raynal <miquel.raynal@bootlin.com>

tpm: allow TPM v1 and v2 to be compiled at the same time

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 <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: In sandbox_tpm2_fill_buf() use NULL not \0 to ensure NULL
terminated string due to LLVM warning]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 350988ff 19-Jul-2018 Miquel Raynal <miquel.raynal@bootlin.com>

tpm: fix typo in kernel doc

The udevice given to the open() function of course must be opened,
not closed.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# ff32245b 15-May-2018 Miquel Raynal <miquel.raynal@bootlin.com>

tpm: prepare support for TPMv2.x commands

Choice between v1 and v2 compliant functions is done with the
configuration.

Create the various files that will receive TPMv2-only code on the same
scheme as for the TPMv1 code.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3219cf69 15-May-2018 Miquel Raynal <miquel.raynal@bootlin.com>

tpm: add missing parameter in private data structure description

Both parameters 'duration_ms' and 'retry_time_ms' of the tpm_chip_priv
structure are documented is the comment above the declaration but 'buf'
was forgotten. Add the missing description.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# d677bfe2 15-May-2018 Miquel Raynal <miquel.raynal@bootlin.com>

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>